<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'xingzhengjs.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<script type='text/javascript' src='<%=basePath%>dwr/interface/TjsUserBo.js'></script>
	 <script type='text/javascript' src="<%=basePath%>dwr/engine.js"></script>
	 <script type='text/javascript' src="<%=basePath%>dwr/util.js"></script>
	 <script type="text/javascript">
 	function closeErrorDiv(){
		document.getElementById("blackdiv").style.display = "none";
		document.getElementById("ErrorDiv").style.display = "none";
	}
	
	function xianshiErrorDiv(){
		document.getElementById("ErrorDiv").style.top = document.body.clientHeight/4;
		document.getElementById("ErrorDiv").style.left = document.body.clientWidth/4;
		document.getElementById("blackdiv").style.display = "block";
		document.getElementById("ErrorDiv").style.display = "block";
	}
	
	function xianshiDan(permission,id,name){
		document.getElementById("DanDiv").style.top = document.body.clientHeight/6;
		document.getElementById("DanDiv").style.left = document.body.clientWidth/8;
		document.getElementById("blackdiv").style.display = "block";
		document.getElementById("DanDiv").style.display = "block";
		document.getElementById("xuanquedan").href = "javaScript:overDan('"+id+"','"+name+"');";
		TjsUserBo.findByLikePermission(permission,GroupDan);
	}
	
	function xianshiDanAndDepartent(permission,id,name,departent){
		document.getElementById("DanDiv").style.top = document.body.clientHeight/6;
		document.getElementById("DanDiv").style.left = document.body.clientWidth/8;
		document.getElementById("blackdiv").style.display = "block";
		document.getElementById("DanDiv").style.display = "block";
		document.getElementById("xuanquedan").href = "javaScript:overDan('"+id+"','"+name+"');";
		TjsUserBo.findByLikePermissionAndDepartent(permission,departent,GroupDan);
	}
	
	function xiaoshiDan(){
		document.getElementById("blackdiv").style.display = "none";
		document.getElementById("DanDiv").style.display = "none";
		document.getElementById('userNameDan').value = '';
		document.getElementById('xuserid').value = '';
		document.getElementById('xusername').value = '';
		document.getElementById("xuanquedan").href = '';
		var DanNameDiv = document.getElementById("DanNameDiv");
		DanNameDiv.innerHTML = '';
	}
	
	function GroupDan(fu){
		var Grouphtml = '<table width="96%" style="margin:3px;"><tr>';
			var b = 1;
			for(var a=0;a<fu.length;a++){
				var id = fu[a].userId;
				var name = fu[a].userName.substring(0,5);
				Grouphtml += '<td width="30%" align="left"><input type="radio" name="123" alt="'+fu[a].userName+'" value="'+id+'" onclick="newDanName(this)"/>'+name+'</td>';
				if(b%3 == 0){
					Grouphtml += '</tr><tr>';
				}else if(a == fu.length-1){
					Grouphtml += '</tr>';
				}
				b++;
			}
			var GroupNameDiv = document.getElementById("DanNameDiv");
			GroupNameDiv.innerHTML = Grouphtml+'</table>';
	}
	function newDanName(str){
		document.getElementById('userNameDan').value = str.alt;
		document.getElementById('xusername').value = str.alt;
		document.getElementById('xuserid').value = str.value;
	}
	function overDan(id,name){
		var xuserid = document.getElementById('xuserid').value;
		var xusername = document.getElementById('xusername').value;
		if(xusername!=''){
			document.getElementById(id).value = ','+xuserid+',';
			document.getElementById(name).value = xusername;
		}else{
			document.getElementById(id).value = '';
			document.getElementById(name).value = '';
		}
		xiaoshiDan();
	}
	 </script>
  </head>
  
  <body>
  </body>
</html>
